from po.base_page import BasePage
from selenium.webdriver.common.by import By


class LogoinPage(BasePage):
    _name_input = By.ID, 'name'
    _password_input = By.ID, 'pass'
    _log_btn = By.CSS_SELECTOR, '[value="登录"]'

    def login_with_username_pass(self, username, passwd):
        self._driver.find_element(*self._name_input).send_keys(username)
        self._driver.find_element(*self._password_input).send_keys(passwd)
        self._driver.find_element(*self._log_btn).click()

